home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH11 / SRC / APIDRAW.BAS next >
BASIC Source File  |  1996-05-01  |  1KB  |  29 lines

  1. Attribute VB_Name = "Metafile"
  2. Option Explicit
  3.  
  4. #If Win32 Then
  5.     Declare Function API_MoveTo Lib "gdi32" Alias "MoveToEx" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As Any) As Long
  6.     Declare Function API_LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
  7. #Else
  8.     Declare Function API_MoveTo Lib "GDI" Alias "MoveTo" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer) As Long
  9.     Declare Function API_LineTo Lib "GDI" Alias "LineTo" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
  10. #End If
  11.  
  12. ' ************************************************
  13. ' Draw a line to a WMF file.
  14. ' ************************************************
  15. Sub WMFDraw(mhdc As Integer, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long)
  16. Dim status As Long
  17.  
  18.     #If Win32 Then
  19.         status = API_MoveTo(mhdc, 10 * x1, 10 * y1, 0&)
  20.     #Else
  21.         status = API_MoveTo(mhdc, 10 * x1, 10 * y1)
  22.     #End If
  23.     
  24.     status = API_LineTo(mhdc, 10 * x2, 10 * y2)
  25. End Sub
  26.  
  27.  
  28.  
  29.